/***********************************************************************
	filename: 	RendererProperties.cpp
	created:	17/9/2005
	author:		Tomas L Olsen (based on code by Paul D Turner)
	
	purpose:	Implements properties for the StaticText class
*************************************************************************/

#include "renderers/StaticImageRenderer.h"
#include "hgePropertyHelper.h"

// Start of RendererProperties namespace section
namespace RendererProperties
{

String  Image::get(const PropertyReceiver* receiver) const
{
    StaticImageRenderer* wr = static_cast<StaticImageRenderer*>(
			static_cast<const Window*>(receiver)->getWindowRenderer());
    return PropertyHelper::imageToString(wr->getImage());
}

void    Image::set(PropertyReceiver* receiver, const String& value)
{
    StaticImageRenderer* wr = static_cast<StaticImageRenderer*>(
			static_cast<Window*>(receiver)->getWindowRenderer());
    wr->setImage(PropertyHelper::stringToImage(value));
}

String	BackgroundEnabled::get(const PropertyReceiver* receiver) const
{
	StaticRenderer* wr = static_cast<StaticRenderer*>(
		static_cast<const Window*>(receiver)->getWindowRenderer());
	return PropertyHelper::boolToString(wr->isBackgroundEnabled());
}


void	BackgroundEnabled::set(PropertyReceiver* receiver, const String& value)
{
	StaticRenderer* wr = static_cast<StaticRenderer*>(
		static_cast<Window*>(receiver)->getWindowRenderer());
	wr->setBackgroundEnabled(PropertyHelper::stringToBool(value));
}

} // End of  RendererProperties namespace section
